/** 
* 2011-9-29 
* ConfigUtils.java 
* author:xfy
*/ 

package com.hutiao.snowhb.common;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;

/**
 * @author Administrator
 *
 */
public class ConfigUtils {
	
	public  String getPo(String pname) {
		String rvalue="";
		Properties props = new Properties();
		try {
			// 资源文件存放在类文件的根目录下。即是放在src下面。
			props.load(getClass().getClassLoader().getResourceAsStream("config.properties"));
			//System.out.println(new String(props.getProperty("name").getBytes("ISO-8859-1"), "GBK"));
			 rvalue=new String(props.getProperty(pname));
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return rvalue;
	}
	
	public static void main(String[] args) {
		String r=new ConfigUtils().getPo("filepath");
		System.out.println(r);
	}
}
